using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableUnionFightResourceDao:DaoBase<TableUnionFightResource>
    {
        public override void AddPrimaryIndex(TableUnionFightResource model)
        {
            cachePrimary[model.UFRId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableUnionFightResource.txt";
        }

        protected override TableUnionFightResource ParseRowData(string[] rowData)
        {
            TableUnionFightResource data = new TableUnionFightResource();
			data.UFRId = rowData [0];
			data.ModelName = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.Level = 0;
            }
            else
            {
                data.Level = int.Parse(rowData[2]);
            }

            if (string.IsNullOrEmpty(rowData[3]))
            {
                data.GatherCostTime = 0;
            }
            else
            {
                data.GatherCostTime = double.Parse(rowData[3]);
            }

            if (string.IsNullOrEmpty(rowData[4]))
            {
                data.GatherTime = 0;
            }
            else
            {
                data.GatherTime = int.Parse(rowData[4]);
            }
			data.GatherCost = rowData [5];
			data.RewardGroupId = rowData [6];

            return data;
        }



    }

}
